<script src="../media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="../media/system/js/core.js" type="text/javascript"></script>
<form action="index.php?top=page&option=com_frcenter" method="post" name="adminForm" id="adminForm">
<!-- LEFT -->
 <?php echo $this->loadTemplate('search','default') ?>
 <!-- END LEFT -->
 
 <!-- CONTENT -->
 <div id="jm-content">
    <div class="cc title">
        
        <div class="id"><?php echo $this->info_ocba->OCBA_CODE; ?></div>
        <div class="cc-title">
            <p class="top"><?php echo $this->info_ocba->OCBA_KANA; ?></p>
            <p class="bot"><?php echo $this->info_ocba->OCBA_NAME; ?><span class="float-right">【<?php echo $this->info_ocba->OCBA_SHOR; ?>】</span></p>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="menu-cc">
        <ul id="nav">
        
        <?php 
            foreach(bgData::getMenuDetailCenter() as $key=>$item){
                $acctive = 'normal';
                if(JRequest::getVar('task') == $key){
                    $acctive = 'current';
                }
         ?>
            <li class="<?php echo $acctive; ?>"><a href="index.php?top=page&option=com_frcenter&task=<?php echo $key; ?>&id=<?php echo $this->info_ocba->OCBA_CODE; ?>"><?php echo $item; ?></a></li>
          <?php } ?>
            
        </ul>
    </div>
    
    <div id="">     
   
     <h3 class="h_title">体育館<span class="right">更新日:<?php if($this->row[0]->GYMT_DATE!='0000-00-00 00:00:00' && $this->row[0]->GYMT_DATE!=null) echo HelperBG::F_GetDate_JP($this->row[0]->GYMT_DATE); ?></span></h3>     
        <div class="info-basic">                            
            <div>
            <?php
                if($this->row[0]->GYMT_CODE != null){
            ?>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>                                        
                                <td><label class="title_" style="width:130px;">第一体育館</label></td>
                                <td class="tb_5c">【開設日】</td>                                
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_SDATE!='0000-00-00 00:00:00' && $this->row[0]->GYMT_SDATE!=null) echo HelperBG::F_GetDate_JP($this->row[0]->GYMT_SDATE); ?></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【譲渡日】</td>
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_TDATE!='0000-00-00 00:00:00' && $this->row[0]->GYMT_TDATE!=null) echo HelperBG::F_GetDate_JP($this->row[0]->GYMT_TDATE); ?></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                            </tr>
                             <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【運営委託業者】</td>
                                <td colspan="4"><?php echo $this->row[0]->GYMT_ADMN; ?></td>
                               
                            </tr>
                            
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【バリアフリー】</td>
                             <?php 
                                 $i=0;
                                foreach($this->tbgy as $key=>$value){
                                    if($i == 4){
                                                    echo '</tr><tr>
                                                            <td><label class="title_"></label></td>
                                                            <td class="tb_5c"></td>';
                                                }
                                                $i++;
                                    $str='□';
                            ?>
                                <td class="tb_5c">
                                
                                <?php if(($this->row[0]->disabled)!= null){
                                            foreach ($this->row[0]->disabled as $vl)
                                                {
                                                    
                                                   if($value->TBGY_CODE == $vl){ $str='■'; break;};
                                                } 
                                        }                                      
                                       
                                    ?>
                              
                                <?php echo $str.$value->TBGY_NAME; $str='□'; ?>
                                </td>
                            <?php
                                   
                                }
                                
                                if($i > 4) { echo "</tr>"; }
                            else{
                                echo "</tr>";
                            }
                            ?>
                                
                        
                       
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【料金】</td>
                                <td class="tb_5c">町内大人：</td>
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_CIAD != null){ echo $this->row[0]->GYMT_CIAD."円"; } ?></td>
                                <td class="tb_5c">町内子供：</td>
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_CICI != null){ echo $this->row[0]->GYMT_CICI."円"; } ?></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c">町外大人：</td>
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_COAD != null){ echo $this->row[0]->GYMT_COAD."円"; } ?></td>
                                <td class="tb_5c">町外子供：</td>
                                <td class="tb_5c"><?php if($this->row[0]->GYMT_COCI != null){ echo $this->row[0]->GYMT_COCI."円"; } ?></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c" style="vertical-align:top">備考：</td>
                                <td class="tb_5c" colspan="4"><?php echo $this->row[0]->GYMT_CNOT; ?></td>
                 
                            </tr>
                            <tr><td></td><td colspan="6"><hr /></td></tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c" style="vertical-align:top">【備考】</td>
                                <td class="tb_5c" colspan="4"><?php echo HelperBGtop::newline2br($this->row[0]->GYMT_NOTE); ?></td>
                                
                            </tr>
                            <tr><td colspan="6"><hr /></td></tr>
                        </tbody>
                    </table>
                    <table width="100%" cellpadding="0" cellspacing="0" border=0>
                        <tbody>
                            <tr>
                                <td><label class="title_" style="width:130px;">ミーティングルーム</label></td>
                                <td class="tb_5c">【利用方法】</td>
                                <td class="tb_5c"><?php echo $this->row[0]->GYMT_METK; ?></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                            </tr>
                            <tr>
                                <td colspan="6"><hr /></td>
                            </tr>
                        </tbody>
                    </table>
                    
                    <table width="100%" cellpadding="0" cellspacing="0" border=0>
                        <tbody>
                           <tr>
                                <td><label class="title_" style="width:130px;">第二体育館</label></td>
                                <td class="tb_5c">【開設日】</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_SDATE!='0000-00-00 00:00:00' && $this->row[1]->GYMT_SDATE!=null) echo HelperBG::F_GetDate_JP($this->row[1]->GYMT_SDATE); ?></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"> </td>
                                <td class="tb_5c"></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【譲渡日】</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_TDATE!='0000-00-00 00:00:00'&& $this->row[1]->GYMT_TDATE!=null) echo HelperBG::F_GetDate_JP($this->row[1]->GYMT_TDATE); ?></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c"> </td>
                                <td class="tb_5c"></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【運営委託業者】</td>
                                <td colspan="4"><?php echo $this->row[1]->GYMT_ADMN; ?></td>
                                
                            </tr>
                             <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【設備】</td>
                                
                              
                                <?php 
                                    //load master
                                     $master = new bgData();
                                     $equip = $master->getListEquipment(); 
                                     foreach($equip as $key=>$value){
                                     $str='□';
                            ?>
                                <td style="width: 10%;">
                                
                                <?php 
                                        //do tim trong list GYMT_TBGY_CODE_LIST de hien thi checkbox
                                       if($this->row[1]->equipment != null){
                                        foreach($this->row[1]->equipment as $val2){
                                            if($value == $val2){ $str='■'; break;};
                                            
                                                }
                                            }                                         
                                    ?>
                              
                                <?php echo $str.$value; $str='□'; ?>
                                </td>
                            <?php
                                   
                                }
                                
                               
                            ?>
                                

                                <td class="tb_5c"></td>
                                <td class="tb_5c"></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c">【料金】</td>
                                <td class="tb_5c">町内大人：</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_CIAD != null){ echo $this->row[1]->GYMT_CIAD."円"; } ?></td>
                                <td class="tb_5c">町内子供：</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_CICI != null){ echo $this->row[1]->GYMT_CICI."円"; } ?></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c">町外大人：</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_COAD != null){ echo $this->row[1]->GYMT_COAD."円"; } ?></td>
                                <td class="tb_5c">町外子供：</td>
                                <td class="tb_5c"><?php if($this->row[1]->GYMT_COCI != null){ echo $this->row[1]->GYMT_COCI."円"; } ?></td>
                            </tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c"></td>
                                <td class="tb_5c" style="vertical-align:top">備考： </td>
                                <td class="tb_5c" colspan="3" style="text-align:justify"><?php echo $this->row[1]->GYMT_CNOT; ?></td>
                            </tr>
                            <tr><td></td><td colspan="6"><hr /></td></tr>
                            <tr>
                                <td><label class="title_"></label></td>
                                <td class="tb_5c" style="vertical-align:top">【備考】</td>
                                <td class="tb_5c" colspan="4"><?php echo HelperBGtop::newline2br($this->row[1]->GYMT_NOTE); ?></td>
                                
                            </tr>
                            
                            
                            <tr><td colspan="6"><hr /></td></tr>
                        </tbody>
                    </table>
         <?php
         }else{
            echo '<p align="center" >データは見つかりませんでした</p>';
         }
         ?>           
                    
         </div>
        </div>                               
        
</div>
    <input type="hidden" name="task" value=""/>
    <input type="hidden" name="boxchecked" value="0"/>
 </div>
 <!-- END CONTENT -->

</form>                          

